#include <stdio.h>
#include "hrd_displayer.h"
#include "hrd_boundary_displayer.h"
#include "hrd_table.h"


void HrdCharDisplayer_DisplayMapInCharacter(int8_t table[8][8], bool show_grid)
{
    int i, j;

    HrdBoundaryDisplayer_DisplayerTopBoundary(table[0]);

    for (i = 1; i < 7; i++) {
        HrdBoundaryDisplayer_DisplayerLeftBoundary(table[i][0]);
        for (j = 1; j < 7; j++) {
            if (table[i][j] < 1 || table[i][j] > 26) {
                printf(" %s", show_grid ? "□" : " ");
                continue;
            }

            printf(" %c", table[i][j] == EMPTY_SPACE_CODE ? ' ' : 'a' + table[i][j] - 1);
        }
        HrdBoundaryDisplayer_DisplayerRightBoundary(table[i][7]);
    }

    HrdBoundaryDisplayer_DisplayerBottomBoundary(table[7]);
}